package com.k2data.k2app.common;

/**
 * Created by clb on 17-6-5.
 */
public enum WaringDealType {
	DEAL_AMQ(0,"amq","站内消息"),
	DEAL_IGNORE(1,"ignore","忽略"),
	DEAL_ORDER(2,"order","工单"),
	DEAL_NO(3,"noDeal","未处理"),
	DEAL_SMS(4,"sms","已经发送短信"),
	DEAL_MAIL(5,"mail","已经发送邮件"),
	DEAL_NEVER(6,"never","不做处理的重复数据"),
	;
	private Integer value;
	private String name;
	private String label;

	private WaringDealType(Integer value,String name,String label){
		this.value = value;
		this.name = name;
		this.label = label;
	}

	public String getName(){
		return this.name;
	}
	public Integer getValue(){
		return this.value;
	}
	public String getLabel(){
		return this.label;
	}

	public static WaringDealType getType(Integer value){
		switch (value){
			case 0:
				return DEAL_AMQ;
			case 1:
				return DEAL_IGNORE;
			case 2:
				return DEAL_ORDER;
			case 3:
				return DEAL_NO;
			case 4:
				return DEAL_SMS;
			case 5:
				return DEAL_MAIL;
			case 6:
				return DEAL_NEVER;
			default:return DEAL_NEVER;
		}
	}

	public static WaringDealType getTypeByName(String name){
		switch (name){
			case "amq":
				return DEAL_AMQ;
			case "ignore":
				return DEAL_IGNORE;
			case "order":
				return DEAL_ORDER;
			case "noDeal":
				return DEAL_NO;
			case "sms":
				return DEAL_SMS;
			case "mail":
				return DEAL_MAIL;
			case "never":
				return DEAL_NEVER;
			default:return DEAL_NEVER;
		}
	}
}
